package com.blandware.atleap.webapp.taglib.core.menu.context;

import javax.servlet.jsp.JspException;
import java.io.IOException;

/**
 * <p>Renders body when enclosing item is disabled.
 * <br />
 * This tag is only valid when nested within <em>item</em> tag.
 * </p>
 * <p>
 * Note: tag body may be rendered twice: first time for including in context
 * menu, second time for including in page (if needed).
 * </p>
 * <p><a href="ItemDisabledTag.java.html"><i>View Source</i></a></p>
 *
 * @author Sergey Zubtsovskiy <a href="mailto:sergey.zubtsovskiy@blandware.com">&lt;sergey.zubtsovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.5 $ $Date: 2006/08/03 10:08:25 $
 * @see ItemTag
 * @see ItemEnabledTag
 * @jsp.tag name="itemDisabled"
 * body-content="scriptless"
 */
public class ItemDisabledTag extends ItemPartSupport implements ItemPart {

	/**
	 * Creates new instance of ItemEnabledTag
	 */
	public ItemDisabledTag() {
	}

	/**
	 * Performs tag logic
	 *
	 * @throws javax.servlet.jsp.JspException
	 * @throws java.io.IOException
	 */
	public void doTag() throws JspException, IOException {

		// set internal flag to false. It means that body content must be
        // processed if and only if 'enabled' field of parent item tag is set
        // to false
		enabled = false;
		super.doTag();

	}
}
